# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-scp
pkgname=('python2-scp' 'python-scp')
_pkgname=scp
pkgver=0.15.0
pkgrel=2
pkgdesc='SCP module for paramiko.'
arch=('any')
url='https://pypi.org/project/scp/#files'
license=('GPL')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('9ca1c3785ed861ba7c09d53ab044bbc8cd12978deb6cd6d29b9846f5a5d506c0bf29f3b18223b2f59e9ea2d58a4ad490f6f9caab81e5214792c64b2f61a895be')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-scp() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-scp() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

